The present invention relates to a memory device having a memory medium which is erasable in block units, and a facsimile apparatus using the memory device.
A facsimile apparatus may employ a dynamic RAM (DRAM) or a static RAM (SRAM) as a memory for storing information to be sent or received. Such a memory may be employed because the facsimile apparatus first stores the information and then starts communication or recording by using the information. Both DRAM and SRAM have been widely used in facsimile apparatuses although they cannot retain information without a power supply. Recently, flash memories have become employed in facsimile apparatuses as a memory for storing information instead of DRAM or SRAM. This is because a flash memory can retain information without a power supply.
The flash memory has more than one block, and the capacity of each block depends on the memory size, but it is generally a rather large capacity such as 64 KB. The data stored in a flash memory is erasable in a blocks. Thus when a user wants to write new data into the flash memory, which is filled with other data, the user desirably first erases all the stored data before writing the new data. When more than one file is stored in a block, and some of the files are ready to be erased after completing their communication or recording, yet, the other files still await communications or recordings and are not erasable, the block cannot be erased. In other words, it is impossible to simply overwrite an erasable file with a new file. Thus, until all the files of the block complete their communications or recordings, the block is never erased and remains occupied. The operation efficiency of the block is thus reduced, and this may mislead users that the apparatus has malfunctioned, because the memory occupancy rate has not decreased although the communication has ended.
The present invention aims to overcome the above problem. In the memory device having more than one block, the present invention has the following three purposes:
The first purpose is to increase the operation efficiency of the memory medium which has more than one block and is erasable by blocks.
The second purpose is to avoid dividing one file and storing it across more than one block.
The third purpose is to minimize situations where one file is divided and stored across more than one block.
In the first exemplary embodiment of the present invention, a memory medium having a specified memory capacity and more than one block is prepared and at least one of the blocks remains vacant for accepting data (hereinafter called Reloadable Block). The data stored in the memory medium is erasable in a one block unit.
In this structure, when erasable data is in one of the blocks containing data, the other data in the specific block is transferred into the Reloadable Block. Thus, all of the data, including the erasable data of the specific block, may be erased. In other words, in the memory medium, erasable in blocks, erasable data can be erased anytime.
In the second exemplary embodiment of the present invention of the present invention, when a file becomes unnecessary among the files written in a block, files other than the unnecessary file are transferred into the Reloadable Block, and all other data including any unnecessary files in the specific block are erased. The specific block then becomes a new Reloadable Block. A new file may be written into the block where the unnecessary data occurred. Thus, the operational efficiency increases, and the new Reloadable Block is ready for accepting data from a block where another unnecessary file will occur.
In the third exemplary embodiment of the present invention of the present invention, the data occupancy rate is set in each block and, when data is stored over the occupancy rate, further data is prohibited from being written into the block and is written into another block. This enables one file to be stored into one block, and also avoids storing one file divided into two blocks. As a result, when one file becomes unnecessary, it is enough to erase that specific block.
In the fourth exemplary embodiment of the present invention of the present invention, a data occupancy rate is set in each block and, when a block is filled with data over the rate, writing is prohibited. When all of the blocks are prohibited from being written and still new data requires to be written, the new data is divided and written into vacant areas of each block corresponding to the sizes of the vacant areas. Therefore, the remaining vacant areas of each block can be utilized effectively.
In the fifth exemplary embodiment of the present invention of the present invention, when a file is divided and written into vacant areas of more than one block, corresponding to the sizes of the vacant areas, if any one of the blocks is erased the file which was divided and stored into the vacant areas is integrated again into one file and stored in the erased block. Accordingly, a file which was once divided and stored into the vacant areas of blocks can be integrated into one file again and then transferred into one block. Thus, when an unnecessary file occurs in a block it is enough to erase that block.